#include <iostream>
#include <vector>

int main()
{
    int N, x;
    std::cin >> N >> x;

    std::vector<int> vec;
    for (int i = 0; i < N; i++)
    {
        int k;
        std::cin >> k;
        vec.push_back(k);
    }

    int total_n = (N * (N + 1)) >> 1;
    int l = 0;
    int r = 0;
    int cnt = 0;
    int sumv = 0;

    while (r < N)
    {
        sumv += vec[r];

        while (sumv >= x && l < r)
        {
            sumv -= vec[l];
            l++;
        }
        if (sumv < x)
        {
            cnt += r + 1 - l;
        }
        r++;
    }

    std::cout << total_n - cnt << std::endl;
    return 0;
}